//1.导入koa-router
const Router = require('koa-router')

//中间件
const { auth } = require('../middleware/auth_middleware')
const { validator } = require('../middleware/cart_middleware')
//控制器
const { add } = require('../controller/cart_cintroller')

//2.实例化路由对象
const router = new Router({ prefix: '/carts' })


//3.编写路由规则

//添加到购物车  登录 ,格式
router.post('/', auth, validator, add)


// 4.导出router对象
module.exports = router